import request from '@/utils/request'
import API from './typeings'
export const login = (data: any) =>
  request({
    url: '/background/admin/login',
    method: 'post',
    data
  })
export const register = (data: any) =>
  request({
    url: '/background/admin/add',
    method: 'post',
    data
  })
//   // 退出
export const userLogout = (params: any) =>
  request({
    url: `/employee/logout`,
    method: 'post',
    params
  })
export async function generateResultByAiAnsynUsingPOST(
  file: File,
  options?: { [key: string]: any }
) {
  const formData = new FormData()
  formData.append('file', file)
  formData.append('chartType', 'chartType')
  formData.append('goal', 'goal')
  return request('/background/aiChart/genByAI', {
    method: 'POST',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    ...(options || {})
  })
}
